bmp1: rb bmp32.szStruc + width*height*4  &&  bmp32 bmp1 width height
  .red: ub '../tst/sdug.red.bmp',0
  .green: ub '../tst/sdug.green.bmp',0
  .blue: ub '../tst/sdug.blue.bmp',0

sdug.color_offset == 1 shl 16
sdug.dest_bmp == bmp1
sdug.dest_file == bmp1.red
call sdug

sdug.color_offset == 1 shl 8
sdug.dest_bmp == bmp1
sdug.dest_file == bmp1.green
call sdug

sdug.color_offset == 1
sdug.dest_bmp == bmp1
sdug.dest_file == bmp1.blue
call sdug

msg msg1
  msg1:ub 'see ../tst/*.bmp',0
ret




sdug:
  .color_offset==
  .dest_bmp==
  .dest_file==

  .x1 == 0
  .x2 == ui32[.dest_bmp+bmp32.biWidth] - 1
  .y1 == 0
  .y2 == ui32[.dest_bmp+bmp32.biHeight] -1

DrawOff;SYNC.bmp32.screen.disable
  while .y1 <= .y2
    .color == (.y1/.y2 * 255) and 255 * .color_offset
    bmp32.pqLineTo   .color .dest_bmp .x1 .y1 .x2 .y1
    .y1 == .y1 + 1
  endw

  bmp32.screen .dest_bmp
  SetEndOfFileA .dest_file ui32[.dest_bmp+bmp32.bfSize]
  ;bmp32.pqFlipY .dest_bmp
  WriteFileA(.dest_bmp .dest_file 0 ui32[.dest_bmp+bmp32.bfSize])
ret
